package Chapter2.Comparing.c8;

import Chapter2.Comparing.c6.User;

import java.io.*;

public class ObjectOutPutDemo {
    public static void main(String[] args) {
        //User user = new User("Tim",50);
        try {
           /* ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("Doc/c.dat"));
            oos.writeObject(user);
            oos.close();*/
            ObjectInputStream ois = new ObjectInputStream(new FileInputStream("Doc/c.dat"));
            User user = (User) ois.readObject();
            System.out.println(user);
        }
        catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
